package com.itheima.service.impl;

import com.itheima.pojo.Account;
import com.itheima.dao.AccountDao01;
import com.itheima.service.AccountService01;

import java.sql.SQLException;
import java.util.List;

public class AccountServiceImpl01 implements AccountService01 {

    private AccountDao01 accountDao01;

    public AccountServiceImpl01() {
    }

    public AccountServiceImpl01(AccountDao01 accountDao01) {
        this.accountDao01 = accountDao01;
    }

    public AccountDao01 getAccountDao01() {
        return accountDao01;
    }

    public void setAccountDao01(AccountDao01 accountDao01) {
        this.accountDao01 = accountDao01;
    }


    public List<Account> findAll() throws SQLException {

        return accountDao01.findAll();
    }

    public void insert(Account account) throws SQLException {
        accountDao01.insert(account);
    }

    public void update(Account account) throws SQLException {
        accountDao01.update(account);
    }

    public void delete(int id) throws SQLException {
        accountDao01.delete(id);
    }
}
